using System;
using System.Collections.Generic;
using System.Text;

namespace Pervote.Core
{
    public class Poll
    {
        public Poll()
        {
            pollItems = new List<PollItem>();
        }

        long id;
        public long Id
        {
            get { return id; }
            set { id = value; }
        }

        long categoryId;
        public long CategoryId
        {
            get { return categoryId; }
            set { categoryId = value; }
        }
        
        string title;
        public string Title
        {
            get { return title; }
            set { title = value; }
        }

        string description;
        public string Description
        {
            get { return description; }
            set { description = value; }
        }

        string startedBy;
        public string StartedBy
        {
            get { return startedBy; }
            set { startedBy = value; }
        }

        DateTime startedOn;
        public DateTime StartedOn
        {
            get { return startedOn; }
            set { startedOn = value; }
        }

        PollTypeCode typeCode;
        public PollTypeCode TypeCode
        {
            get { return typeCode; }
            set { typeCode = value; }
        }

        DateTime endDate;
        public DateTime EndDate
        {
            get { return endDate; }
            set { endDate = value; }
        }

        bool itemsLocked;
        public bool ItemsLocked
        {
            get { return itemsLocked; }
            set { itemsLocked = value; }
        }

        bool allowMultipleVotes;
        public bool AllowMultipleVotes
        {
            get { return allowMultipleVotes; }
            set { allowMultipleVotes = value; }
        }

        List<PollItem> pollItems;
        public List<PollItem> PollItems
        {
            get { return pollItems; }
            set { pollItems = value; }
        }

        private string fqCategoryName;
        public string FQCategoryName
        {
            get { return fqCategoryName; }
            set { fqCategoryName = value; }
        }

        private bool canVoteAgain;
        public bool CanVoteAgain
        {
            get { return canVoteAgain; }
            set { canVoteAgain = value; }
        }

        private long totalVotes;
        public long TotalVotes
        {
            get { return totalVotes; }
            set { totalVotes = value; }
        }

        private long recentVotes;
        public long RecentVotes
        {
            get { return recentVotes; }
            set { recentVotes = value; }
        }

        private long points;

        public long Points
        {
            get { return points; }
            set { points = value; }
        }

        bool allowPics;
        public bool AllowPics
        {
            get { return allowPics; }
            set { allowPics = value; }
        }

        bool allowAudio;
        public bool AllowAudio
        {
            get { return allowAudio; }
            set { allowAudio = value; }
        }

        bool allowVideo;
        public bool AllowVideo
        {
            get { return allowVideo; }
            set { allowVideo = value; }
        }

        public string SimpleCategoryName
        {
            get
            {
                string simpleName = fqCategoryName.Replace('/', '-');
                return simpleName.Trim('-');
            }
        }
    }
}
